Function: useAuth()
useAuth():
UseAuthReturn
Redirect to the Monerium auth flow.
Returns
authorize
- Redirects to the Monerium auth flow.isAuthorized
- Whether the user is authorized.isLoading
- Whether the auth flow is loading.error
- Error message if the auth flow fails.disconnect
- Disconnect the user.revokeAccess
- Revoke the user's access.
Example
const { authorize, isAuthorized, isLoading, error } = useAuth();
authorize(); // Redirects to the Monerium auth flow.
// To opt-in to automated wallet linking, pass the address, signature and chain.
authorize({ address, signature, chain }).